package com.qeng.aiwanba.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

import com.qeng.aiwanba.R;
import com.qeng.aiwanba.util.Constants;
import com.qeng.aiwanba.util.Util;

/**
 * Created by lixy on 2017/10/18.
 */

public class IpSettingActivity extends BaseActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ip_setting);

        final EditText editText = (EditText) findViewById(R.id.ip_edt);

        findViewById(R.id.enter_btn).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String ip = editText.getText().toString();
                if(!Util.isEmpty(ip)){
                    Constants.htmlIp = ip;
                    startActivity(new Intent(IpSettingActivity.this,MainActivity.class));
                    IpSettingActivity.this.finish();
                }
            }
        });
    }
}
